<%@ page import="com.apexedu.identity.entity.TSysUser" %>
<%@ page import="com.apexedu.framework.util.*" %>
<%@ page import="java.util.List" %>
<%@ page import="com.apexedu.portal.util.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    System.out.println(LdapUtil.createO()); //创建根组织机构  即学校
    System.out.println(LdapUtil.createOU("teacher")); //创建老师组
    System.out.println(LdapUtil.createOU("student")); //创建学生组
    /**
     * 导入老师进老师组
     */
    List<TSysUser> userList = new DBUtil().queryAllBeanList("select userloginid,userpwd,userloginid as username," +
            "'teacher' as orname from t_sys_user where state=9", TSysUser.class);
    int i = 0;
    for (TSysUser user : userList) {
        System.out.println(i++ + "::" + user.getUserloginid() + ":" + LdapUtil.addUser(user));
    }
    /**
     * 导入学生进学生组
     */
    userList = new DBMUtil("jw").queryAllBeanList("select UserID as userloginid,UserID as username,Password as userpwd,'student' as orname from tuser  WHERE UserID IN (select XSBH from XS0101  WHERE ZXZT='916')", TSysUser.class);
    i = 0;
    System.out.println(userList.size());
    for (TSysUser user : userList) {
        System.out.println(i++ + "::" + user.getUserloginid() + ":" + LdapUtil.addUser(user));
    }
    /**
     * 添加管理员账号
     */
    TSysUser user = new TSysUser();
    user.setUsername("admin");
    user.setUserloginid("admin");
    user.setUserpwd("admin");
    user.setOrname("teacher");
    System.out.println(LdapUtil.addUser(user));
%>
<html>
<head>
    <title></title>
</head>
<body>

</body>
</html>
